package ewgenius.xube.engine;

import org.lwjgl.Sys;

public class Timer {
	private long currentTime = 0;

	public Timer() {
		currentTime = getTime();
	}

	public long getTime() {
		return (Sys.getTime() * 1000) / Sys.getTimerResolution();
	}

	public int getDelta() {
		long time = getTime();
		int delta = (int) (time - currentTime);
		currentTime = getTime();
		return delta;
	}
}
